The present invention relates to computer systems and more particularly to computer system processors that support predication and perform predicate prediction.
A processor manipulates and controls the flow of data in a computer system. Increasing the speed of the processor will tend to increase the computational power of the computer. Processor designers employ many different techniques to increase processor speed to create more powerful computers for consumers. One technique for increasing processor speed is called predication.
Predication is the conditional execution of instructions depending on the value of a variable called a predicate. For example, consider the two instructions:
COMPARE P=a,b
IF (P) THEN c=d+e
The first instruction, COMPARE P=a,b, determines a value for the predicate P. For example, if a is equal to b, then the value of predicate P is xe2x80x9cTruexe2x80x9d, and if a is not equal to b, then the value of predicate P is xe2x80x9cFalse.xe2x80x9d xe2x80x9cTruexe2x80x9d and xe2x80x9cFalsexe2x80x9d are typically represented in a computer system as single bit values xe2x80x9c1xe2x80x9d and xe2x80x9c0xe2x80x9d, respectively (or xe2x80x9c0xe2x80x9d and xe2x80x9c1xe2x80x9d, respectively, in a negative logic implementation).
The second instruction, IF (P) THEN c=d+e, includes two parts. The first part, IF (P) THEN, predicates (or conditions) the second part, c=d+e, on the value of predicate P. If P is true ( e.g. a xe2x80x9c1xe2x80x9d), then the value of c is set equal to the value of d+e. If P is false (e.g. a xe2x80x9c0xe2x80x9d), then the second part of the instruction is skipped and the processor executes the next sequential instruction in the program code.
Unfortunately, the COMPARE instruction, COMPARE P=a,b, can take a lengthy amount of time to process. Because of this, the execution of subsequent instructions in the program code sequence may be delayed until the COMPARE instruction is resolved.
A method and apparatus for performing predicate prediction is described. In one method, a predicted predicate value for a predicate is determined. A predicated instruction is then conditionally executed depending on the predicted predicate value.
Other features and advantages of the present invention will be apparent from the accompanying drawings and the detailed description that follows.